New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@polymer/iron-test-helpers

Package Overview
Dependencies
Maintainers
11
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polymer/iron-test-helpers

Utility classes to help make testing easier

  • 3.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.9K
increased by25%
Maintainers
11
Weekly downloads
 
Created
Source

Published on NPM Build status Published on webcomponents.org

iron-test-helpers

A set of utility classes to make testing easier. For more details on the methods available, please check the documentation of mock-interactions.js and test-helpers.js

See: Documentation.

Usage

Mock Interactions

This is a set of methods to simulate mouse or keyboard interaction with an element.

import {pressSpace, tap} from '@polymer/iron-test-helpers/mock-interactions.js';

test('can be triggered with space', function(done) {
  button.addEventListener('keydown', function() {
    done();
  });
  pressSpace(button);
});

test('can be clicked', function(done) {
  button.addEventListener('click', function() {
    done();
  });
  tap(button);
});

Note on globals

Note that in version 3.x, importing mock-interactions.js and test-helpers.js will also set the window.MockInteractions and window.TestHelpers globals, respectively (and importing iron-test-helpers.js will set both). This is done only for backwards compatibility, and will be removed in the next major version. All users should migrate away from globals and onto direct ES module imports.

Contributing

If you want to send a PR to this element, here are the instructions for running the tests and demo locally:

Installation

git clone https://github.com/PolymerElements/iron-test-helpers
cd iron-test-helpers
npm install
npm install -g polymer-cli

Running the tests

polymer test --npm

Keywords

FAQs

Package last updated on 14 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc